﻿#include "wnd_main.h"
//#include "minigui_api.h"
#include <minigui/ctrl/static.h>
#include <minigui/ctrl/iconview.h>

#include <minigui/common.h>
#include <minigui/minigui.h>
#include <minigui/gdi.h>
#include <minigui/window.h>
#include <minigui/ctrl/button.h>
#include <minigui/ctrl/edit.h>
#include <minigui/ctrl/scrollview.h>
#include <minigui/ctrl/scrollbar.h>
#include <mgi/mgi.h>

#include "redis_msg_handle.h"
#include "redis_ctrl.h"
#include "wnd_dev_mng.h"
#include "wnd_set.h"
#include "wnd_video_search.h"
#include "mini_gui.h"
//#include "wnd_api.h"
#include "wnd_widget.h"
#include "wnd_handle.h"



#if 0
void WND_MAIN_MenuProc(HWND hWnd, int message, WPARAM wParam, LPARAM lParam);

/* 主界面按钮图标消息*/
WND_API_ICON_MENU_S stGlbIconMenu[] = {
	{
		.s8MapPath = "share/res/png/menu/单面画-黄.png",
		.s8Name = "单面画",
		//.s32Index = MAIN_MENU_INDEX_ONE,
	},
	{
		.s8MapPath = "share/res/png/menu/四面画-黄.png",
		.s8Name = "四面画",
		//.s32Index = MAIN_MENU_INDEX_FOUE,
	},
	{
		.s8MapPath = "share/res/png/menu/九面画-黄.png",
		.s8Name = "九面画",
		//.s32Index = MAIN_MENU_INDEX_NINE,
	},
	{
		.s8MapPath = "share/res/png/menu/录像回放-黄.png",
		.s8Name = "录像回放",
		///.s32Index = MAIN_MENU_INDEX_VIDEO,
	},
	{
		.s8MapPath = "share/res/png/menu/业务菜单-黄.png",
		.s8Name = "业务菜单",
		//.s32Index = MAIN_MENU_INDEX_BUSINESS,
	},
	{
		.s8MapPath = "share/res/png/menu/设备管理.png",
		.s8Name = "设备管理",
		//.s32Index = MAIN_MENU_INDEX_DEV_MNG,
	},

};

MAIN_WIN_FIRST_S stGlbMainWndFirst = {
	.s8MousePath = "sample/res/mouse.png",
	.stIconHandle = {
		.pstIconMenu = stGlbIconMenu,
		.s32IconMenuNum = sizeof(stGlbIconMenu) / sizeof(stGlbIconMenu[0]),
		.s32Id = IDC_MAIN_MENU,
		.u64Style = WS_BORDER | WS_CHILD | WS_THICKFRAME,
		.IconMenuProc = WND_MAIN_MenuProc,
	},
};






int WND_MINI_SwitchProc(HWND hWnd, int s32Switch)
{
	switch(s32Switch) {
		case 0: {
			REDIS_CTRL_AvSetDisplay(pstGlbRedisProc->pstRedisHandle, 0, 0, 0);
			break;
		}
		case 1: {
			REDIS_CTRL_AvSetDisplay(pstGlbRedisProc->pstRedisHandle, 0, 1, 0);
			break;
		}
		case 2: {
			REDIS_CTRL_AvSetDisplay(pstGlbRedisProc->pstRedisHandle, 0, 2, 0);
			break;
		}
		case 3: {

			break;
		}
		case 4: {

			break;
		}
		case 5: {
			WND_API_CreateMainWnd(hWnd, WND_TYPE_DEV_MNG_E);
			break;
		}
	}
	return 0;
}







int WND_MAIN_CreateMouse(WND_API_HANDLE_S *pstMainWnd, HWND hWnd)
{
	HDC hdc;

	if(NULL == pstMainWnd) {
		QLOG(ERR, "窗口结构体为空\n");
		return -1;
	}

	/* 鼠标*/
	MAIN_WIN_FIRST_S *pstMainWndFirst = (MAIN_WIN_FIRST_S *)pstMainWnd->stAttr.pAri;

	hdc = GetDC(hWnd);
	LoadBitmap(hdc, &pstMainWndFirst->stBmpMouse, pstMainWndFirst->s8MousePath);



	pstMainWndFirst->u32WndMouse =CreateWindow(CTRL_STATIC, "",
					WS_CHILD | SS_BITMAP | WS_VISIBLE | SS_REALSIZEIMAGE | SS_CENTERIMAGE | WS_EX_TRANSPARENT,
					IDC_MOUSE,
					pstMainWnd->stAttr.s32WndWidth/2-15, pstMainWnd->stAttr.s32WndHeight/2-15,
					pstMainWnd->stAttr.s32WndWidth/72, pstMainWnd->stAttr.s32WndHeight/40,
					hWnd, (DWORD)&pstMainWndFirst->stBmpMouse);

	//设置颜色
	SetWindowElementAttr(pstMainWndFirst->u32WndMouse, WE_BGC_WINDOW, COLOR_transparent);
	//SetWindowElementAttr(pstMainWndFirst->u32WndMouse, WE_BGC_DESKTOP, 0);
	//SetWindowElementAttr(pstMainWndFirst->u32WndMouse, WE_FGC_WINDOW, 0);
	//SetWindowElementAttr(pstMainWndFirst->u32WndMouse, WE_FGC_WINDOW, Pixel2DWORD (hdc, RGB2Pixel (hdc, 0, 0, 0)));
	//SetWindowElementAttr(pstWndMenu->u32WndTime, WE_FGC_WINDOW, Pixel2DWORD (hdc, RGB2Pixel (hdc, 0xff, 0xff, 0xff)));
	ShowWindow (pstMainWndFirst->u32WndMouse, SW_SHOW);
	ReleaseDC(hdc);

	return 0;
}




void WND_MAIN_MenuProc(HWND hWnd, int message, WPARAM wParam, LPARAM lParam)
{

	WND_API_HANDLE_S * pstMainWnd = NULL;
	pstMainWnd = WND_API_GetMainWnd(WND_TYPE_MAIN_E);

	MAIN_WIN_FIRST_S *pstMainWndFirst = NULL;

	if(NULL == pstMainWnd) {
		QLOG(ERR, "未找到主界面\n");
		return -1;
	}

	pstMainWndFirst = (MAIN_WIN_FIRST_S *)pstMainWnd->stAttr.pAri;
	if(NULL == pstMainWndFirst) {
		QLOG(ERR, "未找到主界面私有属性\n");
		return -1;
	}
	QLOG(TDBG, "message[0x%x] wParam[0x%x] lParam[0x%llx] \n", message, wParam, lParam);

	//switch (message) {
	int id = LOWORD (wParam);
	int code = HIWORD (wParam);
	int sel;
	switch (message) {
		/* 菜单窗口被点击*/
		case IDC_MAIN_MENU:
			if (id == IVN_SELCHANGED) {
				/* 获取失那个菜单按钮被点击*/
				sel = SendMessage (pstMainWndFirst->u32WndMenu, IVM_GETCURSEL, 0, 0);
				QLOG(TDBG, "clicking %d wParam[0x%x]\n", sel, wParam);
				WND_MINI_SwitchProc(hWnd, sel);
			}
		break;
	}
}


int WND_MAIN_CreateMenu(WND_API_HANDLE_S *pstMainWnd, HWND hWnd)
{

	MAIN_WIN_FIRST_S *pstMainWndFirst = (MAIN_WIN_FIRST_S *)pstMainWnd->stAttr.pAri;


	//WND_API_ICON_MENU_HNADLE_S stIconHandle;

	//pstMainWndFirst->stIconHandle.pstIconMenu = stGlbIconMenu;
	//pstMainWndFirst->stIconHandle.s32IconMenuNum = sizeof(stGlbIconMenu) / sizeof(stGlbIconMenu[0]);
	pstMainWndFirst->stIconHandle.u32ParentWnd = hWnd;
	//pstMainWndFirst->stIconHandle.s32Id = IDC_MAIN_MENU;
	//pstMainWndFirst->stIconHandle.u64Style = WS_BORDER | WS_CHILD | WS_THICKFRAME;
	pstMainWndFirst->stIconHandle.s32NewBkcolor = COLOR_lightwhite;
	pstMainWndFirst->stIconHandle.s32WndX = 12;

	pstMainWndFirst->stIconHandle.s32WndY = 3*(pstMainWnd->stAttr.s32WndHeight/4)-pstMainWnd->stAttr.s32WndHeight/25;
	pstMainWndFirst->stIconHandle.s32WndWidth = pstMainWnd->stAttr.s32WndWidth;
	pstMainWndFirst->stIconHandle.s32WndHeight = pstMainWnd->stAttr.s32WndHeight/4 + pstMainWnd->stAttr.s32WndHeight/4;
	pstMainWndFirst->stIconHandle.s23IconWidth = pstMainWnd->stAttr.s32WndWidth/7+10;
	pstMainWndFirst->stIconHandle.s32IconHeight = pstMainWnd->stAttr.s32WndHeight/5+21;


	pstMainWndFirst->u32WndMenu = WND_API_CreateMainWndMenuByIcon(&pstMainWndFirst->stIconHandle);

	SetWindowElementAttr(pstMainWndFirst->u32WndMenu, WE_FGC_WINDOW, 0xF000F000);

	return 0;
}
static char* mk_time (char* buff)
{
	time_t t;
	struct tm * tm;
	time (&t);
	tm = localtime (&t);
	sprintf(buff, "%d-%02d-%02d %02d:%02d:%02d", tm->tm_year+1900, tm->tm_mon+1,tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec);
	return buff;
}


int MINI_MAIN_CreateOsdWnd(WND_API_HANDLE_S *pstMainWnd, HWND hWnd)
{
	char buff[24];
	MAIN_WIN_FIRST_S *pstWndMenu = (MAIN_WIN_FIRST_S *)pstMainWnd->stAttr.pAri;
	pstWndMenu->u32WndTime = CreateWindow (CTRL_STATIC, mk_time(buff),
				   WS_CHILD | WS_VISIBLE | SS_CENTER,
				   IDC_WND_MAIN_TIME,
				   720/2-150,
				   30,
				   300,
				   40, hWnd, 0);

	/* 创建一个间隔为 1 秒的定时器，其标识号为 _ID_TIMER，接收定时器消息的窗口为 hWnd */
	SetTimer(hWnd,66, 100/10);

	/* 设置背景透明*/
	SetWindowElementAttr(pstWndMenu->u32WndTime, WE_BGC_WINDOW, COLOR_transparent);

	PLOGFONT pstFont = CreateLogFont("ttf", "simhei", "UTF-8",FONT_WEIGHT_REGULAR, FONT_SLANT_ROMAN,FONT_FLIP_NIL, FONT_OTHER_NIL,
					FONT_UNDERLINE_NONE, FONT_STRUCKOUT_NONE,20,0);

	/* 设置字体颜色*/
	HDC hdc = GetDC(pstWndMenu->u32WndTime);

	SetWindowElementAttr(pstWndMenu->u32WndTime, WE_FGC_WINDOW, Pixel2DWORD (hdc, RGB2Pixel (hdc, 0xff, 0xff, 0xff)));


	QLOG(TDBG, "颜色 [0x%x]\n", RGBA2Pixel(hdc, 0xff, 0x00, 0x00, 0xF));
	QLOG(TDBG, "颜色 [0x%x]\n", Pixel2DWORD (hdc, RGB2Pixel (hdc, 0xff, 0, 0)));
	QLOG(TDBG, "颜色 [0x%x]\n", RGB2Pixel (hdc, 0x00, 0, 0));

	SetWindowFont(pstWndMenu->u32WndTime,  pstFont);
	ReleaseDC (hdc);


	return 0;
}

int MINI_MainWindowProc(HWND hWnd, int message, WPARAM wParam, LPARAM lParam)
{
    HDC hdc;
	char s8Utf8[64];



	snprintf(s8Utf8, sizeof(s8Utf8), "你好世界你好123456");
	WND_API_HANDLE_S * pstMainWnd = NULL;
	pstMainWnd = WND_API_GetMainWnd(WND_TYPE_MAIN_E);
	MAIN_WIN_FIRST_S *pstMainWndFirst = NULL;

	if(NULL == pstMainWnd) {
		QLOG(ERR, "未找到主界面\n");
		return -1;
	}

	pstMainWndFirst = (MAIN_WIN_FIRST_S *)pstMainWnd->stAttr.pAri;
	if(NULL == pstMainWndFirst) {
		QLOG(ERR, "未找到主界面私有属性\n");
		return -1;
	}

	char buff[24];
	static char s8TimeBuff[24];
    switch (message) {
		case MSG_CREATE:
			QLOG(TDBG, "创建图标\n");

			/* 创建鼠标 */
			WND_MAIN_CreateMouse(pstMainWnd, hWnd);

			/* 创建图标控件*/
			WND_MAIN_CreateMenu(pstMainWnd, hWnd);



			MINI_MAIN_CreateOsdWnd(pstMainWnd, hWnd);




		break;
		case MSG_TIMER:
		{
			/* 接收到定时器消息。
			*/
			//SetTextColor (hdc, COLOR_darkgreen);
			mk_time(buff);
			if(memcmp(buff, s8TimeBuff, strlen(buff))) {
				//hdc = MINI_API_BeginPaint(hWnd);




				SetWindowText(pstMainWndFirst->u32WndTime, buff);


				memcpy(s8TimeBuff, buff, sizeof(s8TimeBuff));

			}

			break;
		}

		case MSG_INITDIALOG:
		{

			QLOG(TDBG, "创建图标\n");

		}
		break;


		/* 鼠标移动*/
		case MSG_MOUSEMOVE:
		{
			int x = LOWORD (lParam);
			int y = HIWORD (lParam);

			MoveWindow(pstMainWndFirst->u32WndMouse , x, y, 10, 20, FALSE);

		}

		break;
		case MSG_RBUTTONUP:
		{
			QLOG(TDBG, "鼠标右键被释放\n");

			if(pstMainWnd) {
				pstMainWndFirst = (MAIN_WIN_FIRST_S *)pstMainWnd->stAttr.pAri;
				if(pstMainWndFirst) {
					if(pstMainWndFirst->bDisplayMenu) {
						ShowWindow (pstMainWndFirst->u32WndMenu, SW_HIDE);
						pstMainWndFirst->bDisplayMenu =false;
					} else {
						ShowWindow (pstMainWndFirst->u32WndMenu, SW_SHOW);
						pstMainWndFirst->bDisplayMenu =true;

					}
				}
			}
		}
		break;
		case MSG_COMMAND:
		{
			int id = LOWORD (wParam);
			int code = HIWORD (wParam);
			int sel;
			switch (id) {
				/* 菜单窗口被点击*/
				case IDC_MAIN_MENU:
					if (code == IVN_CLICKED) {
						/* 获取失那个菜单按钮被点击*/
						sel = SendMessage (pstMainWndFirst->u32WndMenu, IVM_GETCURSEL, 0, 0);
						QLOG(TDBG, "clicking %d wParam[0x%x]\n", sel, wParam);
						WND_MINI_SwitchProc(hWnd, sel);
					}
				break;
			}

		}
		break;
        case MSG_PAINT:
			//QLOG(TDBG, "创建窗口\n");
           	hdc = MINI_API_BeginPaint(hWnd);

			//RGB2Pixel (HDC hdc, Uint8 r, Uint8 g, Uint8 b);
			SetBrushColor (hdc, RGB2Pixel(hdc, 0xff, 0, 0));

			FillBox (hdc, 150, 350, 150, 150);

			/* 设置字体颜色*/
			SetTextColor(hdc, COLOR_red);

			/* 设置字体背景为透明*/
			SetBkMode (hdc, BM_TRANSPARENT);
			TextOut(hdc, 40, 40, s8Utf8);
			//TextOut(hdc, 40, 40, "123456");

			/* 设置字体背景不为透明*/
			SetBkMode (hdc, BM_OPAQUE);
			TextOut(hdc, 80, 80, s8Utf8);

			/* 设置字体背景为透明*/
			SetBkMode (hdc, BM_TRANSPARENT);
			TextOut(hdc, 40, 120, s8Utf8);

            MINI_API_EndPaint (hWnd, hdc);
        	return 0;
        case MSG_CLOSE:
			QLOG(TDBG, "结束主界面\n");
			//DestroyLogFont(pstFont);
            MINI_API_DestroyMainWindow (hWnd);
            MINI_API_PostQuitMessage (hWnd);
            return 0;
    }

    return DefaultMainWinProc(hWnd, message, wParam, lParam);
}


void * WND_MAIN_CreateWnd(void *pArg)
{

	WND_API_HANDLE_S *pstMainWnd = (WND_API_HANDLE_S *)pArg;
#if 1
	unsigned int u32MainWnd;
	WND_API_HANDLE_ATTR_S *pstAttr = &pstMainWnd->stAttr;
	pstMainWnd->stAttr.u32MainWnd = u32MainWnd;
	pstAttr->s32WndX = 0;
	pstAttr->s32WndY = 0;
	pstAttr->s32WndWidth = WND_API_GetScreenWidth();
	pstAttr->s32WndHeight = WND_API_GetScreenHeight();

	u32MainWnd= MINI_INTF_CreateMainWnd(WS_VISIBLE | WS_BORDER, WS_EX_NONE,
										MINI_MainWindowProc,
										0, 0, WND_API_GetScreenWidth(), WND_API_GetScreenHeight(),
										0,//COLOR_transparent,
										(DWORD)pstMainWnd,
										HWND_DESKTOP,
										SW_SHOW);


	MINI_INTF_StartMainWndProc(u32MainWnd);
#else


	WND_API_CreateFullScreenMainWnd(pstMainWnd,WND_API_DEFAULT_STYLE, WND_API_DEFAULT_STYLE, MINI_MainWindowProc, COLOR_transparent, SW_SHOWNORMAL);

#endif
	return NULL;

}

int WND_MAIN_DestroyMainWnd(WND_API_HANDLE_S *pstMainWnd)
{

	MAIN_WIN_FIRST_S *pstMenuWnd = NULL;

	if(NULL == pstMainWnd) {
		QLOG(ERR, "未找到主界面\n");
		return -1;
	}

	pstMenuWnd = (MAIN_WIN_FIRST_S *)pstMainWnd->stAttr.pAri;
	if(NULL == pstMenuWnd) {
		QLOG(ERR, "未找到主界面私有属性\n");
		return -1;
	}

	DestroyWindow(pstMenuWnd->u32WndMouse);
	WND_API_DestroyMainWndMenuByIcon(pstMenuWnd->u32WndMenu, stGlbIconMenu, sizeof(stGlbIconMenu) / sizeof(stGlbIconMenu[0]));
	DestroyMainWindow(pstMainWnd->stAttr.u32MainWnd);

	return 0;
}












#endif





















int MAIN_WND_OneCallBack(HWND u32Wnd, int s32Message, WPARAM u32Param, LPARAM u64Param)
{
	QLOG(TDBG, "单画面切换\n");
	//WND_WIDGET_FlushIconCtrlSetsCursel(u32Wnd);
	WND_WIDGET_FlushDoublePictureButtonCursel(u32Wnd);
	return REDIS_CTRL_AvSetDisplay(pstGlbRedisProc->pstRedisHandle, 0, 0, 0);
}

int MAIN_WND_FourCallBack(HWND u32Wnd, int s32Message, WPARAM u32Param, LPARAM u64Param)
{
	QLOG(TDBG, "四画面切换\n");
	//WND_WIDGET_FlushIconCtrlSetsCursel(u32Wnd);
	WND_WIDGET_FlushDoublePictureButtonCursel(u32Wnd);

	return REDIS_CTRL_AvSetDisplay(pstGlbRedisProc->pstRedisHandle, 0, 1, 0);

}

int MAIN_WND_NineCallBack(HWND u32Wnd, int s32Message, WPARAM u32Param, LPARAM u64Param)
{
	QLOG(TDBG, "九画面切换\n");
	//WND_WIDGET_FlushIconCtrlSetsCursel(u32Wnd);
	WND_WIDGET_FlushDoublePictureButtonCursel(u32Wnd);

	return REDIS_CTRL_AvSetDisplay(pstGlbRedisProc->pstRedisHandle, 0, 2, 0);
}

int MAIN_WND_BusinessCallBack(HWND u32Wnd, int s32Message, WPARAM u32Param, LPARAM u64Param)
{
	QLOG(TDBG, "业务菜单\n");
	//WND_WIDGET_FlushIconCtrlSetsCursel(u32Wnd);
	WND_WIDGET_FlushDoublePictureButtonCursel(u32Wnd);
	return 0;
}

int MAIN_WND_VideoCallBack(HWND u32Wnd, int s32Message, WPARAM u32Param, LPARAM u64Param)
{
	QLOG(TDBG, "录像回放\n");
	//WND_WIDGET_FlushIconCtrlSetsCursel(u32Wnd);
	WND_WIDGET_FlushDoublePictureButtonCursel(u32Wnd);
	return 0;
}

int MAIN_WND_DevMngCallBack(HWND u32Wnd, int s32Message, WPARAM u32Param, LPARAM u64Param)
{


	//LVN_CLICKED
	//int id = LOWORD (wParam);
	//int code = HIWORD (wParam);

	WND_WIDGET_FlushDoublePictureButtonCursel(u32Wnd);



	//if (id == LVN_CLICKED) {
	//if (id == LVN_CLICKED) {
		int sel;
		QLOG(TDBG, "设备管理 %d %d---------------\n", s32Message, u32Param);
		sel = SendMessage (u32Wnd, IVM_GETCURSEL, 0, 0);
		QLOG(TDBG, "clicking %d wParam[0x%x]\n", sel, u32Param);


		WND_HANDLE_CreateMainWnd(MAIN_WND_TYPE_DEV_MNG_E);
		//ShowWindow(GetParent(u32Wnd) , SW_HIDE);
		//ShowWindow(pstWnd->stCommon.stAttr.u32WndId, SW_SHOWNORMAL);



		//QLOG(TDBG, "设备管理 %d %d---------------xxxxxxxxxxxxxxxxxxxxxxxx\n", message, wParam);
	//}


	//MAIN_WND_Create(&stGlbMainModule, MAIN_WND_TYPE_DEV_MNG_E,HWND_DESKTOP,COLOR_black);
	return 0;
}

int MAIN_WND_MouseCallBack(HWND hWnd, int s32Message, WPARAM u32Param, LPARAM u64Param)
{
	QLOG(TDBG, "鼠标\n");
	return 0;
}

int MAIN_WND_MainDestroy(struct wnd_widget_s *pstWidget)
{
	return 0;
}

static char* MAIN_WND_MakeTime (char *ps8Buff)
{
	time_t stTime;
	struct tm *pstTime;
	time (&stTime);
	pstTime = localtime (&stTime);
	sprintf(ps8Buff, "%d-%02d-%02d %02d:%02d:%02d",
		pstTime->tm_year+1900,
		pstTime->tm_mon+1,
		pstTime->tm_mday,
		pstTime->tm_hour,
		pstTime->tm_min,
		pstTime->tm_sec);
	return ps8Buff;
}


/*!
 * 移动鼠标图片的位置 (因为透明窗口会导致鼠标的不可见，所以有这个窗口)
 * @return   0 成功 -1 失败
 * @param s32WndHeight 鼠标图标移动后的高度，虚拟高度
 * @param s32WndWidth 鼠标图标移动后的宽度，虚拟宽度
 * @param s32WndX 真实坐标X
 * @param s32WndY 真实坐标Y
 * @param u32Wnd 要移动的鼠标的窗口id
 * @see
 */
int WND_MAIN_MoveMouse(unsigned int u32Wnd, int s32WndX, int s32WndY, int s32WndWidth, int s32WndHeight)
{

	unsigned int u32WndWidth = (s32WndWidth * stGlbMainWndHandle.s32ScreenWidth) / UI_COORD_MAX;
	unsigned int u32WndHeight = (s32WndHeight * stGlbMainWndHandle.s32ScreenHeight) / UI_COORD_MAX;

	return MINI_INTF_MoveWnd(u32Wnd, s32WndX, s32WndY, u32WndWidth, u32WndHeight);

}

int MINI_MainWndProc(HWND u32Wnd, int s32Message, WPARAM u32Param, LPARAM u64Param)
{
    HDC hdc;


	static bool bMenuShou = true;
	WND_WIDGET_S *pstWnd = (WND_WIDGET_S *)GetWindowAdditionalData(u32Wnd);
	int s32Num;
	//unsigned int u32WndWidth, u32Height;

	WND_WIDGET_S *pstCtrl = NULL;

	static char s8TimeBuff[24];
	char buff[24];
	int s32ChildNum;

    switch (s32Message) {
		case MSG_CREATE:
			pstWnd->stCommon.stAttr.u32WndId = u32Wnd;
			if(pstWnd) {
				for(s32Num = 0; s32Num < pstWnd->s32WidgetNum; s32Num++) {
					pstCtrl = &pstWnd->pstWidget[s32Num];
					WND_WIDGET_Create(&pstWnd->pstWidget[s32Num], pstWnd->stCommon.stAttr.u32WndId);
				}
			}
			/* 开启定时器*/
			SetTimer(u32Wnd, WIDGET_ID_MAIN_TIME_E, 100/10);

		break;
		case MSG_TIMER:
		{
			/* 接收到定时器消息。
			*/
			MAIN_WND_MakeTime(buff);
			if(memcmp(buff, s8TimeBuff, strlen(buff))) {
				if(pstWnd) {
					for(s32Num = 0; s32Num < pstWnd->s32WidgetNum; s32Num++) {
						pstCtrl = &pstWnd->pstWidget[s32Num];
						if(pstCtrl->stCommon.stAttr.u32Id == WIDGET_ID_MAIN_TIME_E) {
							SetWindowText(pstCtrl->stCommon.stAttr.u32WndId, buff);
							break;
						}
					}
				}
				memcpy(s8TimeBuff, buff, sizeof(s8TimeBuff));
			}
			break;
		}

		case MSG_INITDIALOG:
		{



		}
		break;


		/* 鼠标移动*/
		case MSG_MOUSEMOVE:
		{
			int x = LOWORD (u64Param);
			int y = HIWORD (u64Param);
			for(s32Num = 0; s32Num < pstWnd->s32WidgetNum; s32Num++) {
				pstCtrl = &pstWnd->pstWidget[s32Num];
				if(pstCtrl->stCommon.stAttr.u32Group == WIDGET_GRP_MAIN_MOUSE_E) {

					WND_MAIN_MoveMouse(pstCtrl->stCommon.stAttr.u32WndId , x, y,
						pstCtrl->stCommon.stAttr.u32WndWidth,
						pstCtrl->stCommon.stAttr.u32WndHeight);
					UpdateWindow(pstCtrl->stCommon.stAttr.u32WndId, TRUE);
				}
			}

			//MoveWindow(pstMainWndFirst->u32WndMouse , x, y, 10, 20, FALSE);

		}

		break;
		case MSG_RBUTTONUP:
		{
			QLOG(TDBG, "鼠标右键被释放 [%s]\n", pstWnd->stCommon.stAttr.s8Name);
			if(bMenuShou == true) {
				for(s32Num = 0; s32Num < pstWnd->s32WidgetNum; s32Num++) {
					pstCtrl = &pstWnd->pstWidget[s32Num];
					QLOG(TDBG, "隐藏 [%s]\n", pstCtrl->stCommon.stAttr.s8Name);
					if(pstCtrl->stCommon.stAttr.u32Group == WIDGET_GRP_MAIN_MENU_E) {
						ShowWindow(pstCtrl->stCommon.stAttr.u32WndId, SW_HIDE);
						for(s32ChildNum = 0; s32ChildNum < pstCtrl->s32WidgetNum; s32ChildNum++){
							if(pstCtrl->stCommon.stAttr.u32Group == WIDGET_GRP_MAIN_MENU_E) {
								ShowWindow(pstCtrl->pstWidget[s32ChildNum].stCommon.stAttr.u32WndId, SW_HIDE);
							}
						}
					}
				}
				bMenuShou = false;
			} else {
				for(s32Num = 0; s32Num < pstWnd->s32WidgetNum; s32Num++) {
					pstCtrl = &pstWnd->pstWidget[s32Num];
					if(pstCtrl->stCommon.stAttr.u32Group == WIDGET_GRP_MAIN_MENU_E) {
						ShowWindow(pstCtrl->stCommon.stAttr.u32WndId, SW_SHOW);
						for(s32ChildNum = 0; s32ChildNum < pstCtrl->s32WidgetNum; s32ChildNum++){
							if(pstCtrl->stCommon.stAttr.u32Group == WIDGET_GRP_MAIN_MENU_E) {
								ShowWindow(pstCtrl->pstWidget[s32ChildNum].stCommon.stAttr.u32WndId, SW_SHOW);
							}
						}
					}
				}
				bMenuShou = true;
			}
		}
		break;
		case MSG_COMMAND:
		{
			//int id = LOWORD (u32Param);
			//int code = HIWORD (u32Param);
			//int sel;


		}
		break;
        case MSG_PAINT:
           	hdc = BeginPaint(u32Wnd);

            EndPaint (u32Wnd, hdc);
        	return 0;
        case MSG_CLOSE:
			QLOG(TDBG, "结束主界面\n");
            DestroyMainWindow (u32Wnd);
            PostQuitMessage (u32Wnd);
            return 0;
    }

    return DefaultMainWinProc(u32Wnd, s32Message, u32Param, u64Param);
}



int WND_MAIN_MenuProc(HWND u32Wnd, int s32Message, WPARAM u32Param, LPARAM u64Param)
{
	SLOG(TDBG, "菜单按钮被点击\n");

	/* 此回调没有效果 ，也没有用处*/


	return 0;
}






#if 0


WND_WIDGET_S stGlbWndMainChildMenu[] = {


	{
		.enType = WND_WIDGET_TYPE_ICON_VIEW_E,
		.unWidget = {
			.stIconView = {
				//.s8Name = "单画面",
				//.s8Name = "",
				.s8IconPath = "share/res/png/menu/单面画-黄.png",
				.s8IconPathCursel = "share/res/png/menu/单面画.png",
				.enFontColorCursel = UI_COLOR_LIGHTWHITE_E,
			},
		},
		.stCommon = {
			.stAttr = {
				.s8Name = "单画面",
				.u32WndId = 0,
				.u32Group = WIDGET_GRP_MAIN_MENU_E,
				.u32Id = 5561,
				//.u32WndX = (UI_COORD_MAX*1)/6,
				//.u32WndY = (UI_COORD_MAX*1)/6,
				//.u32WndWidth = (UI_COORD_MAX*2)/6,
				//.u32WndHeight = (UI_COORD_MAX*2)/6,
				.enBkColor = UI_COLOR_DEFAULT_E,
				.bShowNow = true,
				//.bBorder = true,
			},
			.stFops = {
				.CallBack = MAIN_WND_OneCallBack,
			},
			//WND_STA_S stSta;
		},

		//.pstWidget = stGlbDlgWndTest,
		//.s32WidgetNum = sizeof(stGlbDlgWndTest) / sizeof(stGlbDlgWndTest[0]),
	},
	{
		.enType = WND_WIDGET_TYPE_ICON_VIEW_E,
		.unWidget = {
			.stIconView = {
				//.s8Name = "四面画",
				.s8Name = "",
				.s8IconPath = "share/res/png/menu/四面画-黄.png",
				.s8IconPathCursel = "share/res/png/menu/四面画.png",
				.enFontColorCursel = UI_COLOR_LIGHTWHITE_E,
			},
		},
		.stCommon = {
			.stAttr = {
				.s8Name = "四面画",
				.u32WndId = 0,
				.u32Group = WIDGET_GRP_MAIN_MENU_E,
				.u32Id = 5562,
				//.u32WndX = (UI_COORD_MAX*1)/6,
				//.u32WndY = (UI_COORD_MAX*3)/6,
				//.u32WndWidth = (UI_COORD_MAX*2)/6,
				//.u32WndHeight = (UI_COORD_MAX*2)/6,
				.enBkColor = UI_COLOR_DEFAULT_E,
				.bShowNow = true,
				//.bBorder = true,
			},
			.stFops = {
				.CallBack = MAIN_WND_FourCallBack,
			},
			//WND_STA_S stSta;
		},

		//.pstWidget = stGlbDlgWndTest,
		//.s32WidgetNum = sizeof(stGlbDlgWndTest) / sizeof(stGlbDlgWndTest[0]),
	},
	{
		.enType = WND_WIDGET_TYPE_ICON_VIEW_E,
		.unWidget = {
			.stIconView = {
				//.s8Name = "九面画",
				.s8IconPath = "share/res/png/menu/九面画-黄.png",
				.s8IconPathCursel = "share/res/png/menu/九面画.png",
				.enFontColorCursel = UI_COLOR_LIGHTWHITE_E,
			},
		},
		.stCommon = {
			.stAttr = {
				.s8Name = "九面画",
				.u32WndId = 0,
				.u32Group = WIDGET_GRP_MAIN_MENU_E,
				.u32Id = 5563,
				//.u32WndX = (UI_COORD_MAX*3)/6,
				//.u32WndY = (UI_COORD_MAX*1)/6,
				//.u32WndWidth = (UI_COORD_MAX*2)/6,
				//.u32WndHeight = (UI_COORD_MAX*2)/6,
				.enBkColor = UI_COLOR_DEFAULT_E,
				.bShowNow = true,
				//.bBorder = true,
			},
			.stFops = {
				.CallBack = MAIN_WND_NineCallBack,
			},
			//WND_STA_S stSta;
		},

		//.pstWidget = stGlbDlgWndTest,
		//.s32WidgetNum = sizeof(stGlbDlgWndTest) / sizeof(stGlbDlgWndTest[0]),
	},
	{
		.enType = WND_WIDGET_TYPE_ICON_VIEW_E,
		.unWidget = {
			.stIconView = {
				//.s8Name = "录像回放",
				.s8Name = "",
				.s8IconPath = "share/res/png/menu/录像回放-黄.png",
				.s8IconPathCursel = "share/res/png/menu/录像回放.png",
				.enFontColorCursel = UI_COLOR_LIGHTWHITE_E,
			},
		},
		.stCommon = {
			.stAttr = {
				.s8Name = "录像回放",
				.u32WndId = 0,
				.u32Group = WIDGET_GRP_MAIN_MENU_E,
				.u32Id = 5564,
				//.u32WndX = (UI_COORD_MAX*3)/6,
				//.u32WndY = (UI_COORD_MAX*1)/6,
				//.u32WndWidth = (UI_COORD_MAX*2)/6,
				//.u32WndHeight = (UI_COORD_MAX*2)/6,
				.enBkColor = UI_COLOR_DEFAULT_E,
				.bShowNow = true,
				//.bBorder = true,
			},
			.stFops = {
				.CallBack = MAIN_WND_VideoCallBack,
			},
			//WND_STA_S stSta;
		},

		//.pstWidget = stGlbDlgWndTest,
		//.s32WidgetNum = sizeof(stGlbDlgWndTest) / sizeof(stGlbDlgWndTest[0]),
	},
	{
		.enType = WND_WIDGET_TYPE_ICON_VIEW_E,
		.unWidget = {
			.stIconView = {
				//.s8Name = "业务菜单",
				.s8Name = "",
				.s8IconPath = "share/res/png/menu/业务菜单-黄.png",
				.s8IconPathCursel = "share/res/png/menu/业务菜单.png",
				.enFontColorCursel = UI_COLOR_LIGHTWHITE_E,
			},
		},
		.stCommon = {
			.stAttr = {
				.s8Name = "业务菜单",
				.u32WndId = 0,
				.u32Group = WIDGET_GRP_MAIN_MENU_E,
				.u32Id = 5565,
				//.u32WndX = (UI_COORD_MAX*3)/6,
				//.u32WndY = (UI_COORD_MAX*1)/6,
				//.u32WndWidth = (UI_COORD_MAX*2)/6,
				//.u32WndHeight = (UI_COORD_MAX*2)/6,
				.enBkColor = UI_COLOR_DEFAULT_E,
				.bShowNow = true,
				//.bBorder = true,
			},
			.stFops = {
				.CallBack = MAIN_WND_BusinessCallBack,
			},
			//WND_STA_S stSta;
		},

		//.pstWidget = stGlbDlgWndTest,
		//.s32WidgetNum = sizeof(stGlbDlgWndTest) / sizeof(stGlbDlgWndTest[0]),
	},
	{
		.enType = WND_WIDGET_TYPE_ICON_VIEW_E,
		.unWidget = {
			.stIconView = {
				//.s8Name = "设备管理",
				.s8Name = "",
				.s8IconPath = "share/res/png/menu/设备管理-黄.png",
				.s8IconPathCursel = "share/res/png/menu/设备管理.png",
				.enFontColorCursel = UI_COLOR_LIGHTWHITE_E,
			},
		},
		.stCommon = {
			.stAttr = {
				.s8Name = "设备管理",
				.u32WndId = 0,
				.u32Group = WIDGET_GRP_MAIN_MENU_E,
				.u32Id = 5566,
				//.u32WndX = (UI_COORD_MAX*3)/6,
				//.u32WndY = (UI_COORD_MAX*1)/6,
				//.u32WndWidth = (UI_COORD_MAX*2)/6,
				//.u32WndHeight = (UI_COORD_MAX*2)/6,
				.enBkColor = UI_COLOR_DEFAULT_E,
				.bShowNow = true,
				//.bBorder = true,
			},
			.stFops = {
				.CallBack = MAIN_WND_DevMngCallBack,
			},
			//WND_STA_S stSta;
		},

		//.pstWidget = stGlbDlgWndTest,
		//.s32WidgetNum = sizeof(stGlbDlgWndTest) / sizeof(stGlbDlgWndTest[0]),
	},

};




#endif




























































WND_WIDGET_S stGlbDoublePictureButtonWnd[] = {


	{
		.enType = WND_WIDGET_TYPE_DOUBLE_PIC_BUTT_E,
		.unPrivate = {
			.stDouPicButt = {
				.s8MapPath = CTRL_PATH"/""menu/单面画-黄.png",
				.s8MapPathCursel = CTRL_PATH"/""menu/单面画.png",
			},
		},
		.stCommon = {
			.stAttr = {
				.s8Name = "单画面",
				.u32WndId = 0,
				.u32Group = WIDGET_GRP_MAIN_MENU_E,
				.u32Id = 5554,
				//.u32WndX = (UI_COORD_MAX*1)/6,
				//.u32WndY = (UI_COORD_MAX*1)/6,
				//.u32WndWidth = (UI_COORD_MAX*4)/6,
				//.u32WndHeight = (UI_COORD_MAX*4)/6,
				.enBkColor = UI_COLOR_DEFAULT_E,
				.bShowNow = true,
				//.bBorder = true,
			},
			.stFops = {
				.CallBack = MAIN_WND_OneCallBack,
			},
		},
	},
	{
		.enType = WND_WIDGET_TYPE_DOUBLE_PIC_BUTT_E,
		.unPrivate = {
			.stDouPicButt = {
				.s8MapPath = CTRL_PATH"/""menu/四面画-黄.png",
				.s8MapPathCursel = CTRL_PATH"/""menu/四面画.png",
			},
		},
		.stCommon = {
			.stAttr = {
				.s8Name = "四面画",
				.u32WndId = 0,
				.u32Group = WIDGET_GRP_MAIN_MENU_E,
				.u32Id = 5555,
				//.u32WndX = (UI_COORD_MAX*1)/6,
				//.u32WndY = (UI_COORD_MAX*1)/6,
				//.u32WndWidth = (UI_COORD_MAX*4)/6,
				//.u32WndHeight = (UI_COORD_MAX*4)/6,
				.enBkColor = UI_COLOR_DEFAULT_E,
				.bShowNow = true,
				//.bBorder = true,
			},
			.stFops = {
				.CallBack = MAIN_WND_FourCallBack,
			},
		},
	},

	{
		.enType = WND_WIDGET_TYPE_DOUBLE_PIC_BUTT_E,
		.unPrivate = {
			.stDouPicButt = {
				.s8MapPath = CTRL_PATH"/""menu/九面画-黄.png",
				.s8MapPathCursel = CTRL_PATH"/""menu/九面画.png",
			},
		},
		.stCommon = {
			.stAttr = {
				.s8Name = "九面画",
				.u32WndId = 0,
				.u32Group = WIDGET_GRP_MAIN_MENU_E,
				.u32Id = 5556,
				//.u32WndX = (UI_COORD_MAX*1)/6,
				//.u32WndY = (UI_COORD_MAX*1)/6,
				//.u32WndWidth = (UI_COORD_MAX*4)/6,
				//.u32WndHeight = (UI_COORD_MAX*4)/6,
				.enBkColor = UI_COLOR_DEFAULT_E,
				.bShowNow = true,
				//.bBorder = true,
			},
			.stFops = {
				.CallBack = MAIN_WND_NineCallBack,
			},
		},
	},



	{
		.enType = WND_WIDGET_TYPE_DOUBLE_PIC_BUTT_E,
		.unPrivate = {
			.stDouPicButt = {
				.s8MapPath = CTRL_PATH"/""menu/录像回放-黄.png",
				.s8MapPathCursel = CTRL_PATH"/""menu/录像回放.png",
			},
		},
		.stCommon = {
			.stAttr = {
				.s8Name = "录像回放",
				.u32WndId = 0,
				.u32Group = WIDGET_GRP_MAIN_MENU_E,
				.u32Id = 5557,
				//.u32WndX = (UI_COORD_MAX*1)/6,
				//.u32WndY = (UI_COORD_MAX*1)/6,
				//.u32WndWidth = (UI_COORD_MAX*4)/6,
				//.u32WndHeight = (UI_COORD_MAX*4)/6,
				.enBkColor = UI_COLOR_DEFAULT_E,
				.bShowNow = true,
				//.bBorder = true,
			},
			.stFops = {
				.CallBack = MAIN_WND_VideoCallBack,
			},
		},
	},

	{
		.enType = WND_WIDGET_TYPE_DOUBLE_PIC_BUTT_E,
		.unPrivate = {
			.stDouPicButt = {
				.s8MapPath = CTRL_PATH"/""menu/业务菜单-黄.png",
				.s8MapPathCursel = CTRL_PATH"/""menu/业务菜单.png",
			},
		},
		.stCommon = {
			.stAttr = {
				.s8Name = "业务菜单",
				.u32WndId = 0,
				.u32Group = WIDGET_GRP_MAIN_MENU_E,
				.u32Id = 5558,
				//.u32WndX = (UI_COORD_MAX*1)/6,
				//.u32WndY = (UI_COORD_MAX*1)/6,
				//.u32WndWidth = (UI_COORD_MAX*4)/6,
				//.u32WndHeight = (UI_COORD_MAX*4)/6,
				.enBkColor = UI_COLOR_DEFAULT_E,
				.bShowNow = true,
				//.bBorder = true,
			},
			.stFops = {
				.CallBack = MAIN_WND_BusinessCallBack,
			},
		},
	},


	{
		.enType = WND_WIDGET_TYPE_DOUBLE_PIC_BUTT_E,
		.unPrivate = {
			.stDouPicButt = {
				.s8MapPath = CTRL_PATH"/""menu/设备管理-黄.png",
				.s8MapPathCursel = CTRL_PATH"/""menu/设备管理.png",
			},
		},
		.stCommon = {
			.stAttr = {
				.s8Name = "设备管理",
				.u32WndId = 0,
				.u32Group = WIDGET_GRP_MAIN_MENU_E,
				.u32Id = 5559,
				//.u32WndX = (UI_COORD_MAX*1)/6,
				//.u32WndY = (UI_COORD_MAX*1)/6,
				//.u32WndWidth = (UI_COORD_MAX*4)/6,
				//.u32WndHeight = (UI_COORD_MAX*4)/6,
				.enBkColor = UI_COLOR_DEFAULT_E,
				.bShowNow = true,
				//.bBorder = true,
			},
			.stFops = {
				.CallBack = MAIN_WND_DevMngCallBack,
			},
		},
	},
};


WND_WIDGET_S stGlbMainWndCtrl[] = {


#if 1

	{
		.enType = WND_WIDGET_TYPE_CTRL_SETS_E,
		.unPrivate = {
			.stCtrlSets = {
				//.s8IconPath = CTRL_PATH"/""menu/菜单栏背景底色.png",
				.s32Direction = 0,		/* 创建横向的*/
				.s32Left = (UI_COORD_MAX*1)/120,						/* 左 端空隙的距离*/
				.s32Right = (UI_COORD_MAX*1)/120,						/* 右 端空隙的距离*/
				.s32Top = (UI_COORD_MAX*1)/60,							/* 上 端空隙的距离*/
				.s32Bottom = (UI_COORD_MAX*1)/50,					/* 下 端空隙的距离*/
			},
		},
		.stCommon = {
			.stAttr = {
				//.s8Name = "控件集合",
				.s8Name = "",
				.u32Group = WIDGET_GRP_MAIN_MENU_E,
				.u32Id = 5568,
#if 1
				.u32WndX = (UI_COORD_MAX*0)/6 + (UI_COORD_MAX*1)/60,
				.u32WndY = (UI_COORD_MAX*3)/4 - (UI_COORD_MAX*1)/16,//(UI_COORD_MAX*1)/45,
				.u32WndWidth = (UI_COORD_MAX*6)/6 - (UI_COORD_MAX*1)/80 - (UI_COORD_MAX*1)/60,
				.u32WndHeight = (UI_COORD_MAX*1)/4 + (UI_COORD_MAX*1)/20,
#else
				.u32WndX = (UI_COORD_MAX*0)/6,
				.u32WndY = (UI_COORD_MAX*0)/4,
				.u32WndWidth = (UI_COORD_MAX*6)/6,
				.u32WndHeight = (UI_COORD_MAX*1)/4,
#endif
				.enBkColor = UI_COLOR_DEFAULT_E,
				.bShowNow = true,
				.bBorder = true,
			},
			.stFops = {
				.CallBack = WND_MAIN_MenuProc,
			},
			//WND_STA_S stSta;
		},
#if 0
		.pstWidget = stGlbWndMainChildMenu,
		.s32WidgetNum = sizeof(stGlbWndMainChildMenu) / sizeof(stGlbWndMainChildMenu[0]),
#else
		.pstWidget = stGlbDoublePictureButtonWnd,
		.s32WidgetNum = sizeof(stGlbDoublePictureButtonWnd) / sizeof(stGlbDoublePictureButtonWnd[0]),
#endif

	},


#endif

	{
		.enType = WND_WIDGET_TYPE_STATIC_TEXT_E,
		.stCommon = {
			.stAttr = {
				.s8Name = "时间显示",
				.u32WndId = 0,
				.u32Group = 0,
				.u64Style = SS_CENTER,
				.u64ExStyle = WS_EX_NONE,
				.u32Id = WIDGET_ID_MAIN_TIME_E,
				.u32WndX = (UI_COORD_MAX * 1)/3,
				.u32WndY = (UI_COORD_MAX * 1)/30,
				.u32WndWidth = (UI_COORD_MAX * 1)/3,
				.u32WndHeight = (UI_COORD_MAX * 1)/15,
				.enBkColor = UI_COLOR_TRANSPARENT_E,
				.bShowNow = true,
				//.bBorder = true,
				.stFont = {
					.enFontColor = UI_COLOR_ORANGE_E,
				},
			},
			.stFops = {
				//.CallBack = MINI_SET_WND_AttrPageProcPowerSleep,
			},
		},
	},





	{
		.enType = WND_WIDGET_TYPE_STATIC_PICTURE_E,
		.unPrivate = {
			.stStaticPicture= {
				.s8MapPath = CTRL_PATH"/""mouse.png",
			},
		},
		.stCommon = {
			.stAttr = {
				.s8Name = "鼠标",
				.u32WndId = 0,
				.u32Group = WIDGET_GRP_MAIN_MOUSE_E,
				//.u32ParentWndId = HWND_DESKTOP,
				.u64Style = SS_BITMAP | WS_EX_TRANSPARENT,
				//.u64ExStyle = WS_EX_NONE,
				.u32Id = 5568,
				.u32Id = 1110,
				.u32WndX = (UI_COORD_MAX * 1)/2,
				.u32WndY = (UI_COORD_MAX * 1)/2,
				.u32WndWidth = (UI_COORD_MAX * 1)/90,
				.u32WndHeight = (UI_COORD_MAX * 1)/30,
				.enBkColor = UI_COLOR_TRANSPARENT_E,
				.bShowNow = true,
				.bBorder = true,
			},
			.stFops = {
				.CallBack = MAIN_WND_MouseCallBack,
			},
			//WND_STA_S stSta;
		},

		//.pstWidget = stGlbMainWndCtrl,
		//.s32WidgetNum = sizeof(stGlbMainWndCtrl) / sizeof(stGlbMainWndCtrl[0]),
	},


};

//int s32MainWidgetNum = sizeof(stGlbMainWndCtrl) / sizeof(stGlbMainWndCtrl[0]);

















WND_WIDGET_S stGlbMainWindow = {
	.enType = WND_WIDGET_TYPE_MAIN_E,
	//WND_WIDGET_ATTR_U unWidget;
	.stCommon = {
		.stAttr = {
			.s8Name = "主画面",
			.u32WndId = 0,
			.u32Group = MAIN_WND_TYPE_MAIN_E,
			//.u32ParentWndId = HWND_DESKTOP,
			//.u64Style = WS_VISIBLE | WS_BORDER,
			//.u64ExStyle = WS_EX_NONE,
			.u32Id = 8,
			.u32WndX = 0,
			.u32WndY = 0,
			.u32WndWidth = UI_COORD_MAX,
			.u32WndHeight = UI_COORD_MAX,
			.enBkColor = UI_COLOR_TRANSPARENT_E,
			//.enBkColor = UI_COLOR_DEFAULT_E,
			//.enBkColor = UI_COLOR_DARKRED_E,
			.bShowNow =true,
			.bBorder = true,
		},
		.stFops = {
			.CallBack = MINI_MainWndProc,
		},
		//WND_STA_S stSta;
	},

	.pstWidget = stGlbMainWndCtrl,
	.s32WidgetNum = sizeof(stGlbMainWndCtrl) / sizeof(stGlbMainWndCtrl[0]),

};






